package com.link2room.aeriabots.dto.callBack;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.util.Date;
import java.util.List;

/**
 * Created by LN on 2016/9/18.
 */
@XStreamAlias("xml")
public class WxCallBackDto {
    public static class MsgType{
        public final static String TEXT = "text";
        public final static String NEWS = "news";
    }

    @XStreamAlias("ToUserName")
    private String toUserName;
    @XStreamAlias("FromUserName")
    private String fromUserName;
    @XStreamAlias("CreateTime")
    private String createTime;
    @XStreamAlias("MsgType")
    private String msgType;
    @XStreamAlias("Event")
    private String event;
    @XStreamAlias("MsgID")
    private String msgId;
    @XStreamAlias("Status")
    private String status;
    @XStreamAlias("Ticket")
    private String ticket;
    @XStreamAlias("Content")
    private String content;
    @XStreamAlias("Nonce")
    private String nonce;
    @XStreamAlias("Encrypt")
    private String encrypt;
    @XStreamAlias("TimeStamp")
    private String timestamp;
    @XStreamAlias("MsgSignature")
    private String msgSignature;
    @XStreamAlias("Image")
    private Media image;
    @XStreamAlias("Voice")
    private Media voice;
    @XStreamAlias("Video")
    private Media video;
    @XStreamAlias("Music")
    private Media music;
    @XStreamAlias("ArticleCount")
    private Integer articleCount;
    @XStreamAlias("Articles")
    private List<Article> articles;
    public String getToUserName() {
        return toUserName;
    }

    public void setToUserName(String toUserName) {
        this.toUserName = toUserName;
    }

    public String getFromUserName() {
        return fromUserName;
    }

    public void setFromUserName(String fromUserName) {
        this.fromUserName = fromUserName;
    }

    public String getCreateTime() {
        if(createTime == null){
            setCreateTime(new Long(new Date().getTime()).toString().substring(0,8));
        }
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getMsgType() {
        return msgType;
    }

    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }

    public String getEvent() {
        return event;
    }

    public void setEvent(String event) {
        this.event = event;
    }

    public String getMsgId() {
        return msgId;
    }

    public String getEncrypt() {
        return encrypt;
    }

    public void setEncrypt(String encrypt) {
        this.encrypt = encrypt;
    }

    public void setMsgId(String msgId) {
        this.msgId = msgId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getTicket() {
        return ticket;
    }

    public void setTicket(String ticket) {
        this.ticket = ticket;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getNonce() {
        return nonce;
    }

    public void setNonce(String nonce) {
        this.nonce = nonce;
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public String getMsgSignature() {
        return msgSignature;
    }

    public void setMsgSignature(String msgSignature) {
        this.msgSignature = msgSignature;
    }

    public Integer getArticleCount() {
        return articleCount;
    }

    public void setArticleCount(Integer articleCount) {
        this.articleCount = articleCount;
    }

    public List<Article> getArticles() {
        return articles;
    }

    public void setArticles(List<Article> articles) {
        this.articles = articles;
    }

    public Media getImage() {
        return image;
    }

    public void setImage(Media image) {
        this.image = image;
    }

    public Media getMusic() {
        return music;
    }

    public void setMusic(Media music) {
        this.music = music;
    }

    public Media getVideo() {
        return video;
    }

    public void setVideo(Media video) {
        this.video = video;
    }

    public Media getVoice() {
        return voice;
    }

    public void setVoice(Media voice) {
        this.voice = voice;
    }

    @XStreamAlias("item")
    public static class Article{
        @XStreamAlias("Title")
        private String titel;
        @XStreamAlias("Description")
        private String description;
        @XStreamAlias("PicUrl")
        private String picUrl;
        @XStreamAlias("Url")
        private String url;

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public String getPicUrl() {
            return picUrl;
        }

        public void setPicUrl(String picUrl) {
            this.picUrl = picUrl;
        }

        public String getTitel() {
            return titel;
        }

        public void setTitel(String titel) {
            this.titel = titel;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }
    }

    public static class Media{
        @XStreamAlias("MediaId")
        private String mediaId;
        @XStreamAlias("Title")
        private String title;
        @XStreamAlias("Description")
        private String descriptiontitle;
        @XStreamAlias("MusicUrl")
        private String musicUrl;
        @XStreamAlias("HQMusicUrl")
        private String hqMusicUrl;
        @XStreamAlias("ThumbMediaId")
        private String thumbMediaId;

        public String getMediaId() {
            return mediaId;
        }

        public void setMediaId(String mediaId) {
            this.mediaId = mediaId;
        }

        public String getDescriptiontitle() {
            return descriptiontitle;
        }

        public void setDescriptiontitle(String descriptiontitle) {
            this.descriptiontitle = descriptiontitle;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getHqMusicUrl() {
            return hqMusicUrl;
        }

        public void setHqMusicUrl(String hqMusicUrl) {
            this.hqMusicUrl = hqMusicUrl;
        }

        public String getMusicUrl() {
            return musicUrl;
        }

        public void setMusicUrl(String musicUrl) {
            this.musicUrl = musicUrl;
        }

        public String getThumbMediaId() {
            return thumbMediaId;
        }

        public void setThumbMediaId(String thumbMediaId) {
            this.thumbMediaId = thumbMediaId;
        }
    }
}
